﻿namespace PVRP_SR
{
    /// <summary>
    /// This tabu attribute class moves a customer between routes.
    /// It does not include days, because 
    /// </summary>
    internal class TabuAttribute
    {
        #region Fields

        /// <summary>
        /// The _aspiration cost.
        /// </summary>
        private double _aspirationCost;

        /// <summary>
        /// The _customer.
        /// </summary>
        private int _customer;

        /// <summary>
        /// The _last iteration in solution.
        /// </summary>
        private int _lastIterationInSolution;

        /// <summary>
        /// The _num iterations included.
        /// </summary>
        private int _numIterationsIncluded;

        /// <summary>
        /// The _route.
        /// </summary>
        private int _route;

        #endregion

        // initialize the tabu attribute with infinity as the objective function value
        // last iteration in solution is set to -1
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="TabuAttribute"/> class.
        /// </summary>
        /// <param name="route">
        /// The route.
        /// </param>
        /// <param name="customer">
        /// The customer.
        /// </param>
        public TabuAttribute(int route, int customer)
        {
            this._route = route;
            this._customer = customer;
            this._aspirationCost = double.MaxValue;
            this._lastIterationInSolution = -1;
            this._numIterationsIncluded = -1;
        }

        // initialize the tabu attribute with aspirationCost as the objective function value
        /// <summary>
        /// Initializes a new instance of the <see cref="TabuAttribute"/> class.
        /// </summary>
        /// <param name="route">
        /// The route.
        /// </param>
        /// <param name="customer">
        /// The customer.
        /// </param>
        /// <param name="aspirationCost">
        /// The aspiration cost.
        /// </param>
        /// <param name="lastIterationInSolution">
        /// The last iteration in solution.
        /// </param>
        /// <param name="numIterationsIncluded">
        /// The num iterations included.
        /// </param>
        public TabuAttribute(
            int route, int customer, double aspirationCost, int lastIterationInSolution, int numIterationsIncluded)
            : this(route, customer)
        {
            this._aspirationCost = aspirationCost;
            this._lastIterationInSolution = lastIterationInSolution;
            this._numIterationsIncluded = numIterationsIncluded;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="TabuAttribute"/> class.
        /// </summary>
        /// <param name="route">
        /// The route.
        /// </param>
        /// <param name="customer">
        /// The customer.
        /// </param>
        /// <param name="lastIterationInSolution">
        /// The last iteration in solution.
        /// </param>
        /// <param name="numIterationsIncluded">
        /// The num iterations included.
        /// </param>
        public TabuAttribute(int route, int customer, int lastIterationInSolution, int numIterationsIncluded)
            : this(route, customer)
        {
            this._lastIterationInSolution = lastIterationInSolution;
            this._numIterationsIncluded = numIterationsIncluded;
        }

        #endregion
    }
}